import rtconfig
from building import *

# get current directory
cwd = GetCurrentDir()

# The set of source files associated with this SConscript file.

src = Split('''
device/core/Source/usbd_core.c
device/core/Source/usbd_enum.c
device/core/Source/usbd_transc.c
driver/Source/drv_usb_core.c
driver/Source/drv_usb_dev.c
driver/Source/drv_usbd_int.c
driver/Source/drv_usb_host.c
driver/Source/drv_usbh_int.c
host/core/Source/usbh_core.c
host/core/Source/usbh_enum.c
host/core/Source/usbh_pipe.c
host/core/Source/usbh_transc.c
''')

path = [
    cwd + '/device/core/Include',
    cwd + '/driver/Include',
    cwd + '/ustd/common',
    cwd + '/host/core/Include',
]

if GetDepend(['USR_USB_USING_CDC']):
    print("USR_USB_USING_CDC----")
    src += ['device/class/cdc/Source/cdc_acm_core.c']
    path += [cwd + '/device/class/cdc/Include']
    path += [cwd + '/ustd/class/cdc']
    print(path)
elif GetDepend(['USR_USB_USING_PRINTER']):
    print("USR_USB_USING_PRINTER----")
    src += ['device/class/printer/Source/printer_core.c']
    path += [cwd + '/device/class/printer/Include']
    print(path)



group = DefineGroup('USBDrivers', src, depend = ['USR_GD_USING_USB'], CPPPATH = path)

Return('group')
